package org.example.sword2offer.primary;

/**
 * @author: lynn
 * @Descript: 求1+2+3+…+n
 * @date: 2021/3/22 19:52
 * @version: 1.0
 */
public class Q47_SumOneTwoThree {
    public static void main(String[] args) {
        System.out.println(Sum_Solution(5));
    }
    public static int Sum_Solution(int n) {
        if (n==1||n==0){
            return n;
        }
        return n+Sum_Solution(n-1);
    }
}
